package com.myidis.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.myidis.request.BBReq;
import com.myidis.request.ForecastReq;
import com.myidis.request.SeasonAdjustReq;
import com.myidis.response.ForecastCompareRes;
import com.myidis.response.ForecastRes;
import com.myidis.servlet.ForecastServlet;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Controller
@RequestMapping("/forecast")
@Api(tags = "预测接口")
public class ForecastController {
	@Autowired
	private ForecastServlet forecastServlet;
	
	@ResponseBody
	@ApiOperation("对单一指标进行预测")
	@RequestMapping(value="/one",method=RequestMethod.POST,consumes= MediaType.APPLICATION_JSON_VALUE)
	public ForecastRes one(@RequestBody ForecastReq req) {
		return forecastServlet.forecast(req);
	}
	
	@ResponseBody
	@ApiOperation("合成指数预测")
	@RequestMapping(value="/ci",method=RequestMethod.POST,consumes= MediaType.APPLICATION_JSON_VALUE)
	public ForecastRes CI(@RequestBody ForecastReq req) {
		return forecastServlet.CI(req);
	}
	
	@ResponseBody
	@ApiOperation("综合警情预测")
	@RequestMapping(value="/sl",method=RequestMethod.POST,consumes= MediaType.APPLICATION_JSON_VALUE)
	public ForecastRes SL(@RequestBody ForecastReq req) {
		return forecastServlet.SL(req);
	}
}
